package com.zhangsr.zk.client.serialize;

import com.zhangsr.zk.client.IZkClient;

/**
 * @Author: zhangsr
 */
public abstract class ZkClientSerializer implements IZkClient {

    protected ZkSerializer zkSerializer;

    protected byte[] serialize(Object data) {
        return zkSerializer.serialize(data);
    }

    protected <T extends Object> T derializable(byte[] data) {
        return data == null ? null : (T) zkSerializer.deserialize(data);
    }
}
